Package-level declarations

Contains all classes/methods for the Mood Analytics feature

Types

Link copied to clipboard
class ChatbotMessageManager(addCurrentBranchLog: (List<ChatMessage>, ChatBranch) -> Unit, addCurrentBranchLogWithDate: (List<ChatMessage>, ChatBranch, Date?) -> Unit)

Manages the flow of messages (sending and generating bot replies) and the logic for different activities in the chatbot.

Link copied to clipboard
class ChatbotViewModel @Inject constructor(chatRepository: ChatRepository) : ViewModel

ViewModel responsible for managing chatbot interactions. Handles message processing, chat logs, and user interactions.

Link copied to clipboard

Represents the different branches or types of conversation in the chatbot dialogue. Each branch corresponds to a specific stage or activity in the cognitive behavioral therapy (CBT) process.

Link copied to clipboard
enum Sender : Enum<Sender>

Represents the sender of a chat message, which can be either the user or the bot.

Functions

Link copied to clipboard

Composable function to display a bot message in the chat.

Link copied to clipboard
fun BotMessageItemReconstruct(branch: ChatBranch, messageNumber: Int)

Displays the bot's message in the chat log, based on the provided branch and message number. The message is shown on the left side of the screen.

Link copied to clipboard
fun ChatbotPage(modifier: Modifier = Modifier, viewModel: ChatbotViewModel = hiltViewModel(), onNavigateToChatList: () -> Unit, openDrawer: () -> Unit)

Composable function for displaying the chatbot page.

Link copied to clipboard
fun ChatbotPageContent(modifier: Modifier = Modifier, viewModel: ChatbotViewModel = viewModel(), onNavigateToChatList: () -> Unit)

Composable function for displaying the content of the Chatbot page. It handles the layout of messages between the user and the bot, along with the display of branch selection buttons and message input. It relies on additional composables such as UserMessageItem and BotMessageItem.

Link copied to clipboard
fun ChatListPage(modifier: Modifier = Modifier, viewModel: ChatbotViewModel = hiltViewModel(), onNavigateToChatbot: () -> Unit, onNavigateToChatLog: (String) -> Unit, openDrawer: () -> Unit)

Main function for the ChatListPage, used to display a list of previously completed chatLogs or cognitive behavioural therapy activities.

Link copied to clipboard
fun ChatLogPage(modifier: Modifier = Modifier, logId: String, onNavigateBack: () -> Unit, viewModel: ChatbotViewModel = hiltViewModel(), openDrawer: () -> Unit)

Composable, displays a ChatLog page that shows previously saved/completed cognitive behavioral therapy activities. This page includes the top app bar and content of the log.

Link copied to clipboard
fun ChatLogPageContent(modifier: Modifier = Modifier, log: ChatLog?, onNavigateBack: () -> Unit)

Composes the content of the chat log page by displaying the log's details.

Link copied to clipboard

Converts a Long representing milliseconds since the epoch to a Date object.

Link copied to clipboard

Converts milliseconds to a date string in "MM/dd/yyyy" format.

Link copied to clipboard

Corrects the date offset by adding one day to the provided date in milliseconds.

Link copied to clipboard
fun DatePickerFieldToModal(modifier: Modifier = Modifier): Long?

Composable for a date picker field that triggers a modal dialog to select a date.

Link copied to clipboard
fun DatePickerModal(onDateSelected: (Long?) -> Unit, onDismiss: () -> Unit)

Composable for a modal date picker dialog, used to select a date.

Link copied to clipboard

Helper function for displaying the different chat branches on buttons.

Link copied to clipboard

Returns the string description for the specified ChatBranch to be used in button selections.

Link copied to clipboard

Returns the display name for a given log type.

Link copied to clipboard
fun LogItem(item: ChatLog, onDelete: () -> Unit, onNavigateToChatLog: (String) -> Unit)

Composable to create a "card" for the ChatLog object.

Link copied to clipboard

Composable function to display a user message in the chat.

Link copied to clipboard

Displays a user's message in the chat log with a timestamp. The message is shown on the right side of the screen.